import Mock from 'mockjs'
import HomeApi from '@/api/MockServerData/home'
import UserApi from "@/api/MockServerData/user";
import PermissionApi from "@/api/MockServerData/permission";
//定义mock请求拦截器
Mock.mock('/api/home/getData',HomeApi.getStatisticalData())
Mock.mock('/api/user/getData',UserApi.getUserData())
Mock.mock('/api/user/add','post',(options)=>{
    return UserApi.addUser(JSON.parse(options.body))
})
Mock.mock('/api/user/delete','post',(options)=>{
    return UserApi.deleteUser(JSON.parse(options.body))
})

Mock.mock('/api/user/edit','post',(options)=>{

    return UserApi.editUser(JSON.parse(options.body))
})

Mock.mock('/api/permission/getMenu','post',(options)=>{
    return PermissionApi.getMenu(JSON.parse(options.body))
})

Mock.mock('/api/permission/logout','post',(options)=>{
    return PermissionApi.logout(options.body)
})
